Carbon


GetIconRefFromFile

Header: Icons.h Carbon status: Supported

Provides an IconRef for a file, folder or volume.

OSErr GetIconRefFromFile (
    const FSSpec *theFile, 
    IconRef *theIconRef, 
    SInt16 *theLabel
);
theFile

A pointer to the FSSpec structure specifying the file, folder or volume for the IconRef.

theIconRef

On return, a pointer to the desired icon data.

theLabel

On return, a pointer to the file or folder’s label.

function result

A result code.

DISCUSSION

Use this function if you have no information about the file object passed in the theFile parameter. If you have already called the File System Manager function PBGetCatInfo, you can use the function GetIconRefFromFolder if the object is a folder without custom icons or the function GetIconRef if the object is a file without custom icons. The GetIconRefFromFile function increments the reference count of the IconRef.

Remember to call the function ReleaseIconRef when you're done with an IconRef.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when IconServicesLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by IconServicesLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/18/2000)